﻿@using QDT.Common
@using QDT.Core
@using QDT.Core.Assignments
@using QDT.Web.Admin.Controllers
@model QDT.Common.IPagedList<QDT.Core.Assignments.Assignment>

@section HeadSection
{
    <script type="text/javascript">

        function show_detail(assignId) {

            var url = '@Url.Action("ShowDetail", "Assignment")' + '?id=' + assignId;

            showAjaxResult(url, "借款详细统计", 700, 400);
        }

    </script>
}

<div class="main_title">
    转让列表</div>
<div class="blank5">
</div>
<div class="button_row">
</div>
<div class="search_row">
    <form name="search" action="@Url.Action("AssignList")" method="get">	
        编号：<input type="text" class="textbox" name="assignmentId" value="@Request.Params["assignmentId"]" size="8"/>
        用户名：<input type="text" class="textbox" name="username" value="@Request.Params["username"]"/>
        状态
        <select name="assignmentStatus">
            <option value="" selected="selected">所有状态</option>
            <option value="1">进行中</option>
            <option value="2">完成</option>
            <option value="3">取消</option>
        </select>
        <input type="submit" class="button" value="搜索"/>
    </form>
</div>
<div class="grid_box">
    <div class="grid_top">
    </div>
    @Html.Grid(Model).Columns(column =>
{
    column.CheckBox(x => x.ID);
    column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;");
    column.For(x => Html.F().GetPrjectName(x.ProjectId)).Named("贷款名称").SortColumnName("ProjectId");
    column.For(x => x.CreateTime).Named("创建时间").HeaderAttributes(style => "width:180px;").SortColumnName("CreateTime");
    column.For(x => Html.F().GetUserName(x.UserId)).Named("借款人").SortColumnName("UserId");
    column.For(x => x.Money.ToMoney()).Named("转让资金").SortColumnName("BorrowAmount");
    column.For(x => x.NeedMoney.ToMoney()).Named("剩余资金").SortColumnName("BorrowAmount");
    column.For(x => x.DiscountRate).Named("折让率").SortColumnName("DiscountRate");
    column.For(x => x.Status.ToLocalizable()).Named("状态").SortColumnName("Status");
    column.Buttons(btns => btns
                               .Add(x => Html.ScriptLink("投资列表", "show_detail({0})", x.ID))
                               .Add(x => Html.ActionLink(x.IsOffline && x.Status.Equals(AssignmentStatus.Progress) ? "投资" : " ", "BidAssign", new { AssignId = x.ID }))
        );
}).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
@Html.Pager(Model)
